import com.sun.security.jgss.GSSUtil;

import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;

public class DoubleBall {

    public static void main(String[] args) {
        int[] arr2 = SuijiBall();

        int[] arr1 = PrintBall();

        Zhongjiang(arr1, arr2);
    }

    public static int[] SuijiBall() {
        int[] arr = new int[7];
        Random r = new Random();
        for (int i = 0; i < 6; i++) {
            int t = 0;
            while (true) {
                boolean flag = false;
                t = r.nextInt(33) + 1;
                for (int j = 0; j < 6; j++) {
                    if(t == arr[j]) {
                        flag = true;
                        break;
                    }

                }
                if(flag == false) {
                    arr[i] = t;
                    break;
                }
            }

        }
        int t = r.nextInt(16) + 1;
        arr[6] = t;
        return arr;
    }

    public static int[] PrintBall() {
        int[] arr = new int[7];
        Scanner sc = new Scanner(System.in);
        int p = 0;
        int j = 0;
        for (int i = 0; i < 6; i++) {
            while (true) {
                System.out.println("请输入第" + (i + 1) + "个红色球号码：");
                p = sc.nextInt();
                if(p >= 1 && p <= 33) {
                    for ( j = 0; j < 6; j++) {
                        if(p == arr[j]) {
                            System.out.println("你输入的号码重复");
                            break;
                        }
                    }
                    if(j == 6) {
                        arr[i] = p;
                        break;
                    }
                } else {
                    System.out.println("请输入正确的号码");
                }
            }
        }
        while (true) {
            System.out.println("请输入蓝色球号码：");
            p = sc.nextInt();
            if(p >= 1 && p <= 16) {
                arr[6] = p;
                break;
            } else {
                System.out.println("请输入正确的号码");
            }
        }
        return arr;
    }

    public static void Zhongjiang(int[] arr1, int[] arr2) {
        int red = 0;
        int blue = 0;
        for (int i = 0; i < 6; i++) {
            for (int j = 0; j < 6; j++) {
                if(arr2[i] == arr1[j]) {
                    red++;
                }
            }
        }
        if(arr1[6] == arr2[6]) {
            blue++;
        }
        if(red == 6 && blue == 1) {
            System.out.println("中1000万");
        } else if (red == 6 && blue == 0) {
            System.out.println("中500万");
        } else if (red == 5 && blue == 1) {
            System.out.println("中3000元");
        } else if (red == 5 && blue == 0 || red == 4 && blue == 1) {
            System.out.println("中200元");
        } else if(red == 4 && blue == 0 || red == 3 && blue == 1) {
            System.out.println("中10元");
        } else if (red == 2 && blue == 1 || red == 1 && blue == 1 || red == 0 && blue == 1) {
            System.out.println("中5元");
        } else {
            System.out.println("感谢参与");
        }
    }
}
